import jQuery from 'jquery'

export default function ({method = 'GET', url} = {}) {
  return new Promise((resolve, reject) => {
    jQuery.ajax({
      method,
      url,
      success(res) {
        resolve(res)
      },
      error(e) {
        reject(e)
      }
    })
  })
}
